package com.wv.model.system;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wv.model.excel.GenderConverter;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("表名")
public class Test implements Serializable {

    @TableId
    @ExcelProperty("ID")
    private String id;

    @ExcelProperty("姓名")
    @NotNull(message = "姓名不能为空")
    private String name;

    @ExcelProperty(value = "性别",converter = GenderConverter.class)
    @Min(value = 2,message = "长度不足")
    private Integer gender;

    @ExcelProperty("生日")
    @DateTimeFormat("yyyy-MM-dd")
    private Date birthday;
}
